<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix = "c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function(){
	$(":radio").click(function(){
		var this_page_size = $(this).val();
		var name = $(":text[name='name']").val();
		var url = "showuser?pageSize="+this_page_size+"&pageNumber=1";
		if(name){
			url += "&name="+name;
		}
		//location.href = url;
	});
	$("#query").click(function(){
		var this_page_size = $(":radio:checked").val();
		var name = $(":text[name='name']").val();
		var url = "showuser?pageSize="+this_page_size+"&pageNumber=1";
		if(name){
			url += "&name="+name;
		}
		location.href = url;
	});
})
</script>
</head>
<body>
<input type="text" name="name" value="${userPageInfo.name }"/> <a id="query" href="javascript:void(0);">query</a>
<table border="1">
	<tr>
		<td>id</td>
		<td>name</td>
		<td>age</td>
	</tr>
<c:forEach items="${userPageInfo.userList}" var="user">
	<tr>
		<td>${user.id}</td>
		<td>${user.name}</td>
		<td>${user.age}</td>
	</tr>
</c:forEach>
</table>
<br/>
当前页:${userPageInfo.pageNumber}|
每页记录数:${userPageInfo.pageSize}
总页数:${userPageInfo.totalPageNumber}|
总记录数:${userPageInfo.totalCount}|
<br/>
<a href="showuser?pageSize=${userPageInfo.pageSize}&pageNumber=1&name=${userPageInfo.name}">first</a>
<a href="showuser?pageSize=${userPageInfo.pageSize}&pageNumber=${userPageInfo.pageNumber - 1}&name=${userPageInfo.name}" <c:if test="${userPageInfo.pageNumber <= 1}">onclick="javascript:return false;"</c:if> >pre</a>
<a href="showuser?pageSize=${userPageInfo.pageSize}&pageNumber=${userPageInfo.pageNumber + 1}&name=${userPageInfo.name}" <c:if test="${userPageInfo.pageNumber >= userPageInfo.totalPageNumber}">onclick="javascript:return false;"</c:if> >next</a>
<a href="showuser?pageSize=${userPageInfo.pageSize}&pageNumber=${userPageInfo.totalPageNumber}&name=${userPageInfo.name}">last</a>
<br/>
<a href="">turnto</a>:<input type="text" id="turn_page" value=""/>
<br/>
pageSize:<input name="ps" type="radio" value="2" checked/>2|<input name="ps" type="radio" value="3"/>3|<input name="ps" type="radio" value="4"/>4
</body>
</html>